package com.xxg.renrencommon.domain.filedenum.userenum;

/**
 * 收益状态枚举
 *
 * @author xxg
 * @date 2020/10/13
 */
public enum BenefitStatusEnum {
    /**
     * 待结算
     */
    UNSETTLED("待结算", 0),
    /**
     * 已结算
     */
    SETTLED("已结算", 1),
    /**
     * 已提现
     */
    REVENUE("已提现", 2),
    ;
    /**
     * 枚举的名称
     */
    private final String name;
    /**
     * 枚举的代码
     */
    private final int value;

    BenefitStatusEnum(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public boolean match(Integer value) {
        return value != null && value == this.value;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return this.value + "_" + this.name;
    }
}
